/* jshint esversion: 6 */
import Vue from 'vue';
import Vuex from 'vuex';
import axios from 'axios';
Vue.use(Vuex);

var $baseUrl = "http://192.168.2.142:3000";
var state = {
    response:[]
};
var getters = {

};
var mutations = {
	LOADDATA(state,response){
		state.response = response;
	}
};
var actions = {
  loadData(context,playload) {
  	console.log(playload);
    axios.get(this.$baseUrl + "/api/home" ).then(function(response) {
        console.log(response);
        console.log(this.$baseUrl + "/api/home");
          context.commit('LOADDATA',response.data.data);
      })
      .catch(function(error) {
        console.log(error);
      });
  }
};
export default new Vuex.Store({
  state,
  getters,
  mutations,
  actions
});


